package com.nondo.dean.product.mapper;

import com.nondo.dean.product.domain.ProductBom;
import com.nondo.dean.product.domain.ProductBomExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface ProductBomMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductBomSqlProvider.class, method="countByExample")
    long countByExample(ProductBomExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @DeleteProvider(type=ProductBomSqlProvider.class, method="deleteByExample")
    int deleteByExample(ProductBomExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Delete({
        "delete from product_bom",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Insert({
        "insert into product_bom (id, product_code, ",
        "product_name, parent_product_code, ",
        "bom_unit, component_unit, ",
        "head_delete, num)",
        "values (#{id,jdbcType=INTEGER}, #{productCode,jdbcType=VARCHAR}, ",
        "#{productName,jdbcType=VARCHAR}, #{parentProductCode,jdbcType=VARCHAR}, ",
        "#{bomUnit,jdbcType=VARCHAR}, #{componentUnit,jdbcType=VARCHAR}, ",
        "#{headDelete,jdbcType=VARCHAR}, #{num,jdbcType=VARCHAR})"
    })
    int insert(ProductBom record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @InsertProvider(type=ProductBomSqlProvider.class, method="insertSelective")
    int insertSelective(ProductBom record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductBomSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_product_code", property="parentProductCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="bom_unit", property="bomUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="component_unit", property="componentUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="head_delete", property="headDelete", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.VARCHAR)
    })
    List<ProductBom> selectByExampleWithRowbounds(ProductBomExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductBomSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_product_code", property="parentProductCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="bom_unit", property="bomUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="component_unit", property="componentUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="head_delete", property="headDelete", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.VARCHAR)
    })
    List<ProductBom> selectByExample(ProductBomExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Select({
        "select",
        "id, product_code, product_name, parent_product_code, bom_unit, component_unit, ",
        "head_delete, num",
        "from product_bom",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_code", property="productCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="parent_product_code", property="parentProductCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="bom_unit", property="bomUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="component_unit", property="componentUnit", jdbcType=JdbcType.VARCHAR),
        @Result(column="head_delete", property="headDelete", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.VARCHAR)
    })
    ProductBom selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductBomSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ProductBom record, @Param("example") ProductBomExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductBomSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ProductBom record, @Param("example") ProductBomExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductBomSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ProductBom record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_bom
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Update({
        "update product_bom",
        "set product_code = #{productCode,jdbcType=VARCHAR},",
          "product_name = #{productName,jdbcType=VARCHAR},",
          "parent_product_code = #{parentProductCode,jdbcType=VARCHAR},",
          "bom_unit = #{bomUnit,jdbcType=VARCHAR},",
          "component_unit = #{componentUnit,jdbcType=VARCHAR},",
          "head_delete = #{headDelete,jdbcType=VARCHAR},",
          "num = #{num,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ProductBom record);
}